
/*
 *  Copyright (c) 2016. For Intelligent Group.
 *
 */

package com.intelligent.ispc.client.core.validator;

import com.intelligent.ispc.client.utils.binding.AbstractBean;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.List;

/**
 * Created by Lucien.Chen on 2016/9/5.
 */
public class SysSpcDto extends AbstractBean {
    public static final String PROPERTYNAME_SPCNDGROUPKEY = "spcNdGroupKey";
    public static final String PROPERTYNAME_SPCCCGROUPKEY = "spcCcGroupKey";
    public static final String PROPERTYNAME_DIGIT = "digit";

    private Long id;

    private boolean ndGroupKey;

    private boolean ccGroupKey;

    @NotEmpty(message = "Not be empty", groups = {GroupKeys.class})
    @Digits(integer = 9, fraction = 0, message = "Not be Integer", groups = {GroupKeys.class})
    @Min(value = 1, message = "Min must be 1", groups = {GroupKeys.class})
    private String spcNdGroupKey;

    @NotEmpty(message = "Not be empty", groups = {GroupKeys.class})
    @Digits(integer = 9, fraction = 0, message = "Not be Integer", groups = {GroupKeys.class})
    @Min(value = 1, message = "Min must be 1", groups = {GroupKeys.class})
    private String spcCcGroupKey;

    private Long digitId;

    @NotEmpty(message = "Not be empty")
    @Digits(integer = 9, fraction = 0, message = "Not be Integer")
    @Max(value = 10, message = "Max must be 10")
    @Min(value = 0, message = "Min must be 0")
    private String digit;

    private List<SysSpcCpwDto> sysSpcCpwDtos;

    private List<SysSpcCcwDto> sysSpcCcwDtos;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSpcNdGroupKey() {
        return spcNdGroupKey;
    }

    /**
     *  fire paroperty change for spcNdGroupKey seted
     *
     * @param spcNdGroupKey new spcNdGroupKey value
     */
    public void setSpcNdGroupKey(String spcNdGroupKey) {
        firePropertyChange(PROPERTYNAME_SPCNDGROUPKEY, this.spcNdGroupKey, this.spcNdGroupKey = spcNdGroupKey);
    }

    public String getSpcCcGroupKey() {
        return spcCcGroupKey;
    }

    /**
     * fire paroperty change for spcCcGroupKey seted
     *
     * @param spcCcGroupKey new spcCcGroupKey value
     */
    public void setSpcCcGroupKey(String spcCcGroupKey) {
        firePropertyChange(PROPERTYNAME_SPCCCGROUPKEY, this.spcCcGroupKey, this.spcCcGroupKey = spcCcGroupKey);
    }

    public List<SysSpcCcwDto> getSysSpcCcwDtos() {
        return sysSpcCcwDtos;
    }

    public void setSysSpcCcwDtos(List<SysSpcCcwDto> sysSpcCcwDtos) {
        this.sysSpcCcwDtos = sysSpcCcwDtos;
    }

    public List<SysSpcCpwDto> getSysSpcCpwDtos() {
        return sysSpcCpwDtos;
    }

    public void setSysSpcCpwDtos(List<SysSpcCpwDto> sysSpcCpwDtos) {
        this.sysSpcCpwDtos = sysSpcCpwDtos;
    }

    public boolean isCcGroupKey() {
        return ccGroupKey;
    }

    public void setCcGroupKey(boolean ccGroupKey) {
        this.ccGroupKey = ccGroupKey;
    }

    public boolean isNdGroupKey() {
        return ndGroupKey;
    }

    public void setNdGroupKey(boolean ndGroupKey) {
        this.ndGroupKey = ndGroupKey;
    }

    public String getDigit() {
        return digit;
    }

    public Long getDigitId() {
        return digitId;
    }

    public void setDigitId(Long digitId) {
        this.digitId = digitId;
    }

    /**
     * fire paroperty change for digit seted
     *
     * @param digit new digit value
     */
    public void setDigit(String digit) {
        firePropertyChange(PROPERTYNAME_DIGIT, this.digit, this.digit = digit);
    }
}
